package com.tongji.diy.model.furniturePlacementOptimization.complementStructs
{
	import com.tongji.diy.model.furniturePlacementOptimization.assembleComplement.FurnitureBase;

	public class CompConverBlock
	{
		private var _list:Vector.<FurnitureBase>;
		public function CompConverBlock(list:Vector.<FurnitureBase> = null)
		{
			if(list)
				_list = list;
			else
				_list = new Vector.<FurnitureBase>;
		}
		
		public function get list():Vector.<FurnitureBase>
		{
			return _list;
		}
		
		public function get width():Number
		{
			var width:Number = 0;
			for(var i:int = 0; i < _list.length; ++i)
				width += _list[i].width;
			return width;
		}
		
		public function get length():Number
		{
			var length:Number = 0;
			for(var i:int = 0; i < _list.length; ++i)
			{
				if(length < _list[i].length)
					length = _list[i].length;
			}
			return length;
		}
	}
}